﻿using Fuse8.ContentManagementFramework.Domain;
using Fuse8.ContentManagementFramework.Domain.Bases;
using System.Collections.Generic;

namespace Fuse8.ContentManagementFramework.Web.ApplicationRuntime
{
    public interface IMembershipService
    {
        int MinPasswordLenght { get; }

        string PasswordRegex { get; }

        int PasswordHistoryDepth { get; }

        CmsUser CreateUser(string loginName, string userEmail, string userName, bool isSystem, SiteAwareCategory category, string lastname, string password, bool isSendEmail, string locale);

        void UpdateUser(CmsUser user, bool isSendEmail);

        void UpdateUser(CmsUser user, string newPassword, bool isSendEmail);

        void DeleteUser(CmsUser user);

        bool ValidateUser(string loginName, string password);

        void ResetUserPassword();

        CmsUserGroup CreateUserGroup(string groupName, bool isSystem, SiteAwareCategory category);

        void UpdateUserGroup(CmsUserGroup userGroup);

        void DeleteUserGroup(CmsUserGroup userGroup);

        void AssignToGroups(CmsUser user, IEnumerable<CmsUserGroup> userGroups);

        void RemoveFromGroups(CmsUser user, IEnumerable<CmsUserGroup> userGroups);

        bool IsUserInGroup(string userName, string userGroupName);

        IEnumerable<CmsUserGroup> GetUserGroups(CmsUser user);

        IEnumerable<CmsUserGroup> GetAllUserGroups();
    }
}